package algorithm.poj.p2000;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLDecoder;
import java.util.Arrays;
import java.util.StringTokenizer;


/**
 * 分析：
 * 
 * 实现：
 * 
 * 经验：
 * 
 * 教训：
 * 
 * @author wong.tong@gmail.com
 *
 */
public class P2008 {

	public static void main(String[] args) throws Exception {

		InputStream input = null;
		if (false) {
			input = System.in;
		} else {
			URL url = P2008.class.getResource("P2008.txt");
			File file = new File(URLDecoder.decode(url.getPath(), "UTF-8"));
			input = new FileInputStream(file);
		}
		
		BufferedReader stdin = new BufferedReader(new InputStreamReader(input));
		
		String line = stdin.readLine();
		int N = Integer.valueOf(line.trim());
		StringTokenizer st = new StringTokenizer(stdin.readLine());
		int A = Integer.valueOf(st.nextToken());
		int B = Integer.valueOf(st.nextToken());
		int C = Integer.valueOf(st.nextToken());
		
		P[] ps = new P[N];
		for (int i = 0; i < N; i ++) {
			ps[i] = new P(stdin.readLine());
			ps[i].m = A*ps[i].h + B*ps[i].w - C;
		}
		Arrays.sort(ps);
		int max = 0;
		for (int i = 0; i < N; i ++) {
			P ph = ps[i];
			for (int j = 0; j < N; j ++) {
				P pw = ps[j];
				if (i == j || (ph.h <= pw.h && pw.w <= ph.w 
						&& B*(ph.w - pw.w) <= C && A*(pw.h - ph.h) <= C)) {
					P p = new P();
					p.m = A*ph.h + B*pw.w + 1;
					int index = Arrays.binarySearch(ps, p);
					if (index < 0) {
						index = -index-1;
					}
					int count = 0;
					for (int k = 0; k < index; k ++) {
						if (ps[k].h >= ph.h && ps[k].w >= pw.w && ps[k].m <= p.m) count ++;
					}
					if (count > max) max = count;
				} else {
					continue;
				}
			}
		}
		System.out.println(max);
	}
	
	public static class P implements Comparable<P> {
		
		int h;
		int w;
		int m;
		
		public P() {}
		
		public P(String s) {
			
			StringTokenizer st = new StringTokenizer(s);
			this.h = Integer.valueOf(st.nextToken());
			this.w = Integer.valueOf(st.nextToken());
		}

		public int compareTo(P p) {
			return Integer.valueOf(this.m).compareTo(p.m);
		}
		
		public String toString() {
			return m + "(h=" + h + ", w=" + w + ")";
		}
	}
}
